﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SimpleSalesTrackingAPIWrapper
{
    public class Schedules
    {
        // Get list of all Schedules
        public static List<SimpleSalesTrackingAPI.Schedule> GetSchedules(string username, string password)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();
            return new List<SimpleSalesTrackingAPI.Schedule>(api.GetSchedules(username, password));
        }

        // Get a single Schedule, by ScheduleId
        public static SimpleSalesTrackingAPI.Schedule GetScheduleById(string username, string password, int scheduleId)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();
            return api.GetScheduleById(username, password, scheduleId);
        }

        // Insert a new Schedule
        public static int InsertSchedule(string username, string password, SimpleSalesTrackingAPI.Schedule schedule)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();
            return api.InsertSchedule(username, password, schedule);
        }

        // Insert a new Schedule
        public static int InsertSchedule(string username, string password, int saleId, string name, DateTime startDate, DateTime endDate, int scheduleTypeId)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();
            return api.InsertSchedule2(username, password, saleId, name, startDate, endDate, scheduleTypeId);
        }

        // Update an existing Schedule
        public static int UpdateSchedule(string username, string password, SimpleSalesTrackingAPI.Schedule schedule)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();
            return api.UpdateSchedule(username, password, schedule);
        }

        // Update an existing Schedule
        public static int UpdateSchedule(string username, string password, int scheduleId, int saleId, string name, DateTime startDate, DateTime endDate, int scheduleTypeId)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();
            return api.UpdateSchedule2(username, password, scheduleId, saleId, name, startDate, endDate, scheduleTypeId);
        }

        // Delete an existing Schedule
        public static int DeleteSchedule(string username, string password, SimpleSalesTrackingAPI.Schedule schedule)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();
            return api.DeleteSchedule(username, password, schedule);
        }

        // Delete an existing Schedule
        public static int DeleteSchedule(string username, string password, int scheduleId)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();
            return api.DeleteSchedule2(username, password, scheduleId);
        }

    }
}
